package org.tech4j.disruptor.subsriber;


import org.tech4j.disruptor.consumer.QueueConsumerFactory;

import java.util.HashSet;
import java.util.Set;

/**
 * @program: ppc-common
 * @description:
 * @author: YuKai Fan
 * @create: 2025/1/3 15:38
 **/
public abstract class AbstractQueueConsumerFactory<T> implements QueueConsumerFactory<T> {

    private final Set<ExecutorSubscriber<T>> subscribers = new HashSet<>();

    public AbstractQueueConsumerFactory<T> addSubscribers(final ExecutorSubscriber<T> subscriber) {
        subscribers.add(subscriber);
        return this;
    }

    public Set<ExecutorSubscriber<T>> getSubscribers() {
        return subscribers;
    }
}
